<?php
	$this->helpers->html->JavaScript("popupWindow('/printpreview/formatselection/');");


	echo "<p class = 'printTitle'>".ucfirst($this->data[grid][title])."</p>";
	echo "<table class = 'gridPrint' cellpadding = '0' cellspacing = '0' id = 'gridPrint'>";
		echo "<tr>";
		foreach ($this->data[grid][header] as $header)
		{
			echo "<td class = 'gridHeaderPrint'>".ucfirst($header)."</td>";
		}
		echo "</tr>";
		
		$i = 0;
		
		//prints all selected grid rows. If none selected, prints all rows
		foreach ($this->data[grid][content] as $row)
		{
			if ((!in_array($i, $this->selectedRows)) && (!empty($this->selectedRows)))
			{
				$i++;
				continue;
			}
			echo "<tr>";
			foreach ($row as $cell)
			{
				echo "<td class = 'gridPrint'>$cell</td>";
			}
			echo "</tr>";
			$i++;
		}
	echo "</table>";
	
?>